home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 8
/
The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO
/
prg_basi
/
regsrc.zip
/
REGISTRY.CLS
< prev
Wrap
Text File
|
1996-10-01
|
1KB
|
52 lines
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "Registry"
Attribute VB_Creatable = True
Attribute VB_Exposed = True
Public Sub ReadData(dRoot As String, KeyName As String, KeyValue As String)
Dim KeyHandle As Long
Dim KeyValueLength As Long
Dim Ret As Long
'
' initialize string with enough space to receive data
' otherwise, GPF will occur
'
Value = Space(512)
'
' get previous size and position information from the INI file
'
KeyValue = Space(512)
KeyValueLength = Len(KeyValue)
Ret = RegOpenKey(dRoot, KeyName, KeyHandle)
If Ret <> 0 Then
Exit Sub
End If
Ret = RegQueryValue(KeyHandle, KeyName, KeyValue, KeyValueLength)
If Ret <> 0 Then
Ret = RegCloseKey(KeyHandle)
Exit Sub
End If
End Sub
Public Sub SaveData(dRoot As String, KeyName As String, KeyValue As String)
Dim KeyHandle As Long
Dim Ret As Long
KeyName = "WGP\" & AppName & "\Form Position"
KeyValue = CurForm.Left & " " & CurForm.Top & " " & CurForm.Width & " " & CurForm.Height
Ret = RegCreateKey(dRoot, KeyName, KeyHandle)
If Ret <> 0 Then
Exit Sub
End If
Ret = RegSetValue(KeyHandle, KeyName, REG_SZ, KeyValue, Len(KeyValue))
Ret = RegCloseKey(KeyHandle)
End Sub